import {exit} from "@/api/settingApi"
import cookie from "@/util/cookie"
import {busiUrl} from "@/config/config"
const setting = {
    namespaced: true,
    state: {
    },
    getters: {

    },
    mutations: {
    },
    actions: {
        loginOut (){
            var openId = cookie.get("OpenId")

            exit({
             openId:openId
            }).then((data) => {
                var data=JSON.parse(data)
                if(data.Code==200){
                   cookie.clearAll()
                    // console.log(data);
                    localStorage.clear()

                    var url = location.origin + location.pathname
                    // location.href = busiUrl + '/study/static/signUp.html'
                    location.href = url.replace('index.html', 'static/signUp.html')

                }

            });
        }

    }
}
export default setting
